package com.doodod.common.utils;

/**
 * Created with IntelliJ IDEA.
 * User: 邱孝兵
 * Date: 14-2-28
 * Time: 下午3:53
 */
public class MyConstants {

    public final static String API_URL_PREFIX = "/api";

    public final static int OK = 0;

    public final static class APP_ID {
        public final static String IOS = "ios";
        public final static String ANDROID = "android";
        public final static String CMS = "cms";

        public final static int PLATFORM_LIMIT = -1;
        public final static String PLATFORM_LIMIT_DES = "平台权限限制";
    }

    // 用户类型 1普通用户 2初级会员 3中级会员 4高级会员 5管理员
    public final static class USER_TYPE {
        public final static int USER_FREE = 1;
        public final static int USER_PRIMARY_VIP = 2;
        public final static int USER_MIDDLE_VIP = 3;
        public final static int USER_ADVANCE_VIP = 4;
        public final static int USER_TYPE_ADMIN = 5;

        public final static int FREE_FOCUS_ACCOUNT_NUM = 3;
        public final static int PRIMARY_FOCUS_ACCOUNT_NUM = 10;
        public final static int MIDDLE_FOCUS_ACCOUNT_NUM = 50;
        public final static int ADVANCE_FOCUS_ACCOUNT_NUM = 100;

        public final static int FREE_FOCUS_ARTICLE_NUM = 3;
        public final static int PRIMARY_FOCUS_ARTICLE_NUM = 10;
        public final static int MIDDLE_FOCUS_ARTICLE_NUM = 50;
        public final static int ADVANCE_FOCUS_ARTICLE_NUM = 100;
    }

    // 定时统计设置
    public final static class CRONTAB_SET {
        public static String RECORD_DATE;               // 统计日期，每次统计开始时，更新
        public static String RECORD_TIME;               // 最近一次统计时间，每次统计结束时，更新
    }

    public final static class CRAWLER_SET {
        public final static int ARTICLE_READ_ZAN_COUNT_DAYS = 7;               // 统计7天内发布的文章阅读，点赞数
    }

    public final static class ACCOUNT {
        public final static int RANKDISPLAYNUM = 200;   // 排名数量
        public final static int RANKPAGESIZE = 20;      // 单页排名数量
        public final static int RANK_PAGE_TOTAL = 10;   // 总榜页数
        public final static int GROUPDISPLAYSIZE = 12;  // 同组公众账号显示数量
        public final static int PAGESIZE = 20;          // 单页数量
    }

    public final static class ARTICLE {
        public final static int PAGESIZE = 20;          // 每页显示文章数
        public final static int PAGESIZE_KEYWORD = 10;  // 用户关注关键词页面文章数
        public final static int HOTREAD = 100;          // 文章热门门限
        public final static int HOTZAN = 50;            // 文章热门门限
        public final static int DAYS_DISPLAY = 3;       // 显示几天的文章
        public final static int DAYS = 7;               // 近几天的文章运营状态

        public final static int HAS_DAY = 7;            // 需要维护的文章时间维度
        public final static int CRAWLED_DAY = 3;        // 需要抓取近N天的文章
    }

    public final static class UIN_KEY {
        public final static int UIN_KEY_POOL_SIZE = 7;
        public final static int SLEEP_TIME = 430;
    }

    public final static class VPN {
        public final static String VPN_FILE_PATH = "/tmp/vpn.tmp";
    }

    public static class ErrCode {
        // 执行成功
        public final static int SUCCESS = 0;
        public final static String SUCCESS_DES = "正确";

        // 错误的参数
        public final static int WRONG_PARAM = -1;
        public final static String WRONG_PARAM_DES = "错误的参数";

        // 非法登陆
        public final static int ILLEGAL_LAND = -2;
        public final static String ILLEGAL_LAND_DES = "非法登陆";

        // 数据库错误
        public final static int WRONG_DB = -3;
        public final static String WRONG_DB_DES = "数据库错误";

        // 超过请求权限
        public final static int AUTH_ILLEGAL = -3;
        public final static String AUTH_ILLEGAL_DES = "超过请求权限";

        // 系统内部错误
        public final static int SYSTEM_ERROR = 99;
        public final static String SYSTEM_ERROR_DES = "系统内部错误";

    }


    public final static class MAIL {
        public final static int MAIL_SEND_SUC = 0;
        public final static String MAIL_SEND_SUC_DES = "邮件发送成功";

        public final static int MAIL_SEND_FAIL = -1;
        public final static String MAIL_SEND_FAIL_DES = "邮件发送失败";
    }

    // 声明公众号
    public static class CLAIM{
        public final static int NOT_EXIST_PUBLIC = -1;
        public final static String NOT_EXIST_PUBLIC_DES = "关注的公众账号未被纪录";

        public final static int URL_ILLEGAL = -2;
        public final static String URL_ILLEGAL_DES = "提交的URL不合法";
    }

    public static class UserErrCode {
        // 昵称已存在
        public final static int NICK_EXIST_ERROR = -1;
        public final static String NICK_EXIST_ERROR_DES = "昵称已存在";
        //Email已存在
        public final static int EMAIL_EXIST_ERROR = -2;
        public final static String EMAIL_EXIST_ERROR_DES = "Email已存在";
        // 电话已存在
        public final static int PHONE_EXIST_ERROR = -4;
        public final static String PHONE_EXIST_ERROR_DES = "电话已存在";
        // 第三方账号已存在
        public final static int THIRD_EXIST_ERROR = -8;
        public final static String THIRD_EXIST_ERROR_DES = "第三方账号已存在";


        public final static int NAME_NOT_EXIST_ERROR = -10000;
        public final static String NAME_NOT_EXIST_ERROR_DES = "用户不存在";

        public final static int PWD_NOT_MATCH_ERROR = -10001;
        public final static String PWD_NOT_MATCH_ERROR_DES = "密码不正确";

        // token不存在
        public final static int TOKEN_ERROR = -10002;
        public final static String TOKEN_ERROR_DES = "token不存在";

        // token不匹配
        public final static int TOKEN_NOT_MATCH_ERROR = -10003;
        public final static String TOKEN_NOT_MATCH_ERROR_DES = "token不匹配";

        //被block
        public final static int BLOCK_ERROR = -10005;
        public final static String BLOCK_ERROR_DES = "由于对方限制无法进行操作";

        public final static int USER_EMAIL_NOT_EXIST = -10006;
        public final static String USER_EMAIL_NOT_EXIST_DES = "邮箱不存在";


        //信息存在
        //public final static int USER_EXIST_ERROR = -100;
        public final static String USER_EXIST_ERROR_DES = "用户已存在";
    }

    public static class ApplyInvitationErrCode{

        public final static int APPLY_ERROR = -1;
        public final static String APPLY_ERROR_DES = "申请错误";

        public final static int CODE_ERROR = -2;
        public final static String CODE_ERROR_DES = "邀请码错误";


        public final static int CODE_NULL = -3;
        public final static String CODE_NULL_DES = "邀请码错误";

        public final static int EMAIL_EXIST = -4;
        public final static String EMAIL_EXIST_DES = "邮箱已存在";
    }

    public static class ApplyCode{

        public final static int APPLY_NEW_COUNT = 5;   //新注册用户给N个邀请码

        public final static int APPLY_RESULT_UN = 0;    //没处理
        public final static int APPLY_RESULT_OK = 1;    //同意
        public final static int APPLY_ERROR_REFUSE = 2; //不同意

        public final static int ALLOC_TYPE_NEW = 1;     //新用户得到N个
        public final static int ALLOC_TYPE_EMAIL = 2;   //邮箱注册得到
        public final static int ALLOC_TYPE_AFTER = 3;   //N个以后又申请的
        public final static int ALLOC_TYPE_SYSTEM = 4;   //系统下发的

    }
}